(function($){"use strict";var marqueeAttempts=0,marqueeTO,marqueeCheckResize,initMarquee;UNCODE.textMarquee=function($titles){var isInitMarque=!1,initTextMarquee=function($titles){typeof $titles=="undefined"&&($titles=$(".un-text-marquee"));if(!$titles.length)return;isInitMarque=!0;var stableHeight=UNCODE.wheight;$titles.each(function(){var $title=$(this),$span=$("> span, > i > span",$title),txt,first=!0,dataSpeed=parseFloat($title.closest(".heading-text").attr("data-marquee-speed")),dataSpace=parseFloat($title.closest(".heading-text").attr("data-marquee-space")),dataTrigger=$title.closest(".heading-text").attr("data-marquee-trigger"),hasSticky=!1,dataNavBar=$title.closest(".heading-text").attr("data-marquee-navbar"),dataNavBarMobile=$title.closest(".heading-text").attr("data-marquee-navbar-mobile"),newW=UNCODE.wwidth,marqueeTL,inview,isInMenu=$title.closest(".megamenu-block-wrapper").length;if($title.closest(".sticky-trigger").length||$title.closest(".sticky-element").length||$title.closest(".pin-spacer").length)hasSticky=!0,dataTrigger="row";UNCODE.wwidth<=UNCODE.mediaQuery&&(dataNavBar=dataNavBarMobile),dataSpeed=isNaN(dataSpeed)?0:dataSpeed,dataSpace=isNaN(dataSpace)?"default":dataSpace;var dataX=dataSpeed;dataSpeed+=5,$(".marquee-clone-wrap",$title).remove(),txt=$span.html(),$(".marquee-original-core",$span).length?txt=$(".marquee-original-core",$span).html():(txt=$span.html(),$span=$("> span, > i > span",$title).wrapInner('').addClass("marquee-original"));var spanW,$prepended=$(''),$appended=$(''),speed=10-dataSpeed;$span.prepend($prepended),$span.append($appended);var continuousTextMarquee=function(){var bound=$title.css({transform:"none",opacity:0}).offset(),ease="none",xStrt=first||$title.hasClass("un-marquee-infinite")?0:UNCODE.wwidth-bound.left,xEnd=$title.hasClass("un-marquee-infinite")?spanW:spanW+bound.left,xSpeed=(xEnd+xStrt)/(dataSpeed*dataSpeed*dataSpeed)/5*dataSpeed,direction=$title.hasClass("un-marquee-opposite")?1:-1,speedSlow=(xEnd+xStrt)/45,transFormVal,translX;marqueeTL=new TimelineMax({paused:!0,reversed:!0}),marqueeTL.play();var inViewElement=dataTrigger==="row"?hasSticky?$title.closest(".sticky-trigger, .sticky-element").parent()[0]:$title.closest(".vc_row")[0]:$title[0],wayOff=dataTrigger==="row"&&dataNavBar==="yes"?UNCODE.menuHeight:0;isInMenu?($(document).on("un-menu-show.marquee",function(e,$ul){marqueeTL.restart()}),$(document).on("un-menu-hide.marquee",function(e,$ul){marqueeTL.pause()})):inview=new Waypoint.Inview({element:inViewElement,offset:wayOff,enter:function(direction){marqueeTL.play()},exited:function(direction){$title.closest(".pin-spacer").length||marqueeTL.pause()}});if($title.hasClass("un-marquee-hover")){var $column=$title.closest(".wpb_column"),$col_link=$(".col-link",$column),$hover_sel=$title;$col_link.length&&($hover_sel=$title.add($column)),$hover_sel.on("mouseover",function(){ease="power2.out",transFormVal=$title.css("transform").split(/[()]/)[1],translX=transFormVal.split(",")[4],speedSlow=(xEnd+(xStrt-translX))/45,marqueeTL.duration(speedSlow)}).on("mouseout",function(){ease="power2.in",transFormVal=$title.css("transform").split(/[()]/)[1],translX=transFormVal.split(",")[4],speedSlow=(xEnd+(xStrt-translX))/(dataSpeed*dataSpeed*dataSpeed)/5*dataSpeed,marqueeTL.duration(speedSlow)})}gsap.killTweensOf($title),marqueeTL.fromTo($title,{opacity:1,x:xStrt*direction*-1},{duration:xSpeed,x:xEnd*direction,onComplete:function(){first=!1,isInMenu?marqueeTL.restart():continuousTextMarquee()},onUpdate:function(){$title[0].isConnected||(marqueeTL.kill(),initTextMarquee())},ease:ease})},runTextMarquee=function(){var time=Date.now(),textMarqueeScroll=function(){var $row=$title.closest(".vc_row");hasSticky&&($row=$title.closest(".sticky-trigger, .sticky-element").parent());var $bound=dataTrigger==="row"||dataTrigger==="row-middle"?$row:$title;if(!$bound.length)return;var bound=$bound[0].getBoundingClientRect(),wait=100,direction=$title.hasClass("un-marquee-scroll-opposite")?-1:1,dataMove=dataX>=0?1+dataX:-1*5/(dataX-.5)*.25;bound.top===0&&bound.bottom===0&&bound.left===0&&bound.right===0&&bound.height===0&&bound.width===0&&bound.x===0&&bound.y===0&&marqueeAttempts<2&&(clearRequestTimeout(marqueeTO),marqueeTO=requestTimeout(function(){marqueeAttempts++,runTextMarquee()},100));var bound_top=bound.top,gsap_calc=(stableHeight*.35-bound_top)*dataMove*.5*direction;if(dataTrigger==="row"||dataTrigger==="row-middle")dataTrigger==="row-middle"&&(bound_top=bound.top+bound.height*.5-stableHeight*.5),dataNavBar==="yes"&&(bound_top-=UNCODE.menuHeight),gsap_calc=bound_top*dataMove*.5*direction;gsap.killTweensOf($title),gsap.to($title,{duration:.24,x:gsap_calc})};textMarqueeScroll(),$(window).on("load scroll",function(e){textMarqueeScroll()})},cloneSpan=function($_title,cntnt){$_title.hasClass("un-marquee-infinite")&&$("> span.marquee-clone-wrap",$_title).text(""),gsap.to($_title,{duration:0,x:0}),spanW=$span.outerWidth();if(!spanW)return;var part=Math.ceil(UNCODE.wwidth/spanW)*2,spaceSpan=dataSpace!=="default"?' ':" ";if($_title.hasClass("un-marquee-infinite"))for(var i=0;i